Skip to content

ZOOKEEPER-4915: Default znode.container.maxNeverUsedIntervalMs to 5 minutes #2248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kezhuw
Copy link
Member

@kezhuw kezhuw commented Apr 20, 2025

This will delete container nodes that never had any children after approximately 5 minutes.

Given this property, you should be prepared to get KeeperException.NoNodeException
when creating children inside of this container node

Container nodes are supposed to be deleted after all children deleted, so from client's perspective this change has no harm. And also, it leaves no unused nodes in data tree.

…inutes

This will delete container nodes that never had any children after
approximately 5 minutes.

> Given this property, you should be prepared to get `KeeperException.NoNodeException`
> when creating children inside of this container node

Container nodes are supposed to be deleted after all children deleted,
so from client's perspective this change has no harm. And also, it
leaves no unused nodes in data tree.
@kezhuw kezhuw force-pushed the ZOOKEEPER-4915-znode.container.maxNeverUsedIntervalMs-default-value branch from bd7ca89 to 3121b0d Compare June 26, 2025 00:40
zkDb, requestProcessor,
Integer.getInteger("znode.container.checkIntervalMs", (int) TimeUnit.MINUTES.toMillis(1)),
Integer.getInteger("znode.container.maxPerMinute", 10000),
Long.getLong("znode.container.maxNeverUsedIntervalMs", TimeUnit.MINUTES.toMillis(5))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default 5-minute cleanup is a breaken change and is not recommended i think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it break things ? Container nodes with no children are supposed to be deleted.

/**
* The znode will be a container node. Container
* nodes are special purpose nodes useful for recipes such as leader, lock,
* etc. When the last child of a container is deleted, the container becomes
* a candidate to be deleted by the server at some point in the future.
* Given this property, you should be prepared to get
* {@link org.apache.zookeeper.KeeperException.NoNodeException}
* when creating children inside of this container node.
*/
CONTAINER(4, false, false, true, false),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants